// custom-tab-bar/index.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: "#8E8E93",
    selectedColor: "#020202",
    list: [
      {
        pagePath: "/pages/courseware/courseware",
        iconPath: "/resourse/tabbar/tabbar-watch-normal.png",
        text: "",
        tagNum: 0,
        selectedIconPath: "/resourse/tabbar/tabbar-watch-select.png"
      }, 
      {
        pagePath: "/pages/home/home",
        iconPath: "/resourse/tabbar/tabbar-home-normal.png",
        text: "",
        tagNum: 0,
        selectedIconPath: "/resourse/tabbar/tabbar-home-select.png"
      },
      {
        pagePath: "/pages/cart/cart",
        iconPath: "/resourse/tabbar/tabbar-cart-normal.png",
        text: "",
        tagNum: 0,
        selectedIconPath: "/resourse/tabbar/tabbar-cart-select.png"
      },
      {
        pagePath: "/pages/shop/shop",
        text: "",
        tagNum: 0,
        iconPath: "/resourse/tabbar/tabbar-shop-normal.png",
        selectedIconPath: "/resourse/tabbar/tabbar-shop-select.png"
      },
      {
        pagePath: "/pages/user/user",
        text: "",
        tagNum: 0,
        iconPath: "/resourse/tabbar/tabbar-user-normal.png",
        selectedIconPath: "/resourse/tabbar/tabbar-user-select.png"
      }
    ]
  },
  
  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({ url })
      // this.setData({
      //   selected: data.index
      // })
      // app.globalData.tabSelected=data.index;
      
    }
  },
  
})
